﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test.Site.Data
{

    /// <summary>
    /// 全站会用到的正则表达式集合
    /// </summary>
    public static class ValidationConstant
    {
        /// <summary>
        /// 用户名
        /// </summary>
        public const string UserNameValReg = @"^[a-zA-z0-9][\.\@a-zA-Z0-9_]{3,100}$";
        public const string UserNameValMessage = "用户名错误，请输入英文或数字，不区分大小写";

        /// <summary>
        /// 验证码
        /// </summary>
        public const string SmsCodeValReg = @"^\d{4,6}$";
        public const string SmsCodeValMessage = "验证码格式错误";

        /// <summary>
        /// 图形验证码
        /// </summary>
        public const string ImgCodeValReg = @"^[a-zA-Z0-9]{4,6}$";
        public const string ImgCodeValMessage = "图形验证码格式错误";

        /// <summary>
        ///  密码
        /// </summary>
        public const string PasswordValReg = @"^[\@A-Za-z0-9\!\#\$\%\^\&\*\.\~]{6,16}$";
        public const string PasswordValMessage = @"请输入6-16位数字、字母或常用符号，区分大小写";


        /// <summary>
        ///  手机
        /// </summary>
        public const string PhoneValReg = @"^(13[0-9]|14[0-9]|15[0-9]|18[0-9]|17[0-9])\d{8}$";
        public const string PhoneValMessage = @"请输入正确的手机号码";

        /// <summary>
        /// 邮箱
        /// </summary>
        public const string EmailValReg = @"^[\w-\._\+%]+@(?:[\w-]+\.)+[\w]{2,6}$";
        public const string EmailValMessage = @"邮箱地址格式错误，请核对后再试";

        /// <summary>
        ///  姓名
        /// </summary>
        public const string TrueNameValReg = @"^([a-z\u4e00-\u9fa5]{2,6}|[a-zA-Z\s]{2,50})$";
        public const string TrueNameValMessage = @"请正确输入您的姓名";

        /// <summary>
        ///  姓名
        /// </summary>
        public const string ChineseTrueNameValReg = @"^([a-z\u4e00-\u9fa5]{2,7})$";
        public const string ChineseTrueNameValMessage = @"请正确输入您的姓名";

        /// <summary>
        /// 昵称校验格式
        /// </summary>
        public const string NickNameValReg = @"^([_0-9a-z\u4e00-\u9fa5]{1,7})$";
        public const string NickNameValMessage = @"昵称不能超过7个字，只能包含汉字、英文、数字、下划线'_'";

        ///// <summary>
        /////  职位
        ///// </summary>
        //public const string PositionValReg = @"^[\w]{2,20}$";
        //public const string PositionValMessage = @"请正确输入您的职位";

        /// <summary>
        /// QQ号校验（有可能也是手机号）
        /// </summary>
        public const string QQValReg = @"^([1-9][0-9]{4,10})$";
        public const string QQValMessage = @"请输入正确的QQ号码";


        public const string PermalinkValReg = @"^[a-zA-Z0-9_]{1,100}$";
        public const string PermalinkValMessage = "专链格式错误，请输入纯英文数字，不区分大小写";


        //public const string LngValReg = @"^-?(([1-9]\d?)|(1[1-7]\d)|180)(\.\d{1,6})?$";
        //public const string LngValMessage = "经度格式错误";


        //public const string LatValReg = @"^-?(([1-8]\d?)|([1-8]\d)|90)(\.\d{1,6})?$";
        //public const string LatValMessage = "纬度格式错误";
    }
}
